using System;
using System.Collections.Generic;
using System.Text;

namespace CS_raytracer
{
    public class CColor
    {
        public double r;
        public double g;
        public double b;

        public CColor(double _r, double _g, double _b)
        {
            r = _r;
            g = _g;
            b = _b;
        }

        public CColor()
        {
            r = 0.0;
            g = 0.0;
            b = 0.0;
        }

        public static CColor operator +(CColor lhs, CColor rhs)
        {
            return new CColor(lhs.r + rhs.r, lhs.g + rhs.g, lhs.b + rhs.b);
        }

        public static CColor operator -(CColor lhs, CColor rhs)
        {
            return new CColor(lhs.r - rhs.r, lhs.g - rhs.g, lhs.b - rhs.b);
        }

        public static CColor operator *(CColor lhs, CColor rhs)
        {
            return new CColor(lhs.r * rhs.r, lhs.g * rhs.g, lhs.b * rhs.b);
        }

        public static CColor operator *(CColor lhs, double rhs)
        {
            return new CColor(lhs.r * rhs, lhs.g * rhs, lhs.b * rhs);
        }

        public static CColor operator /(CColor lhs, double rhs)
        {
            return new CColor(lhs.r / rhs, lhs.g / rhs, lhs.b / rhs);
        }
    }
}
